package folexpr.presentation;

import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.JSplitPane;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.DefaultButtonModel;
import javax.swing.BorderFactory;
import javax.swing.border.BevelBorder;
import javax.swing.JButton;
import java.awt.Dimension;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.GridBagConstraints;
import java.awt.Color;
import java.awt.Font;
import java.awt.Insets;
import java.awt.Point;
import java.util.Collection;
import java.util.Iterator;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
import java.io.StringReader;

import folexpr.compiler.CompilerConstants;
import folexpr.compiler.CompilerFrontEnd;
import folexpr.compiler.state.StepsImagesContainer;
import folexpr.parser.ParseException;
import folexpr.parser.TokenMgrError;
import folexpr.presentation.ParseErrorWindow;
import folexpr.presentation.TextAreaOutputStream;

import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JDialog;
import java.awt.BorderLayout;
import javax.swing.JFileChooser;
import java.awt.event.KeyEvent;
import java.awt.SystemColor;
import javax.swing.border.SoftBevelBorder;

public class FOLExprObserver2 extends JFrame {

	
	/////////////////////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////
	
	
	
	private CompilerFrontEnd compiler;
	
	/**
	 * This is the default constructor
	 */
	public FOLExprObserver2(CompilerFrontEnd compiler)
	{
		super();
		this.compiler = compiler;	
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize()
	{
		this.setLocation(0, 0);
		this.setSize(1100, 770);
		this.setJMenuBar(getJJMenuBar());
		this.setContentPane(getJContentPane());
		this.setTitle("First Order Logic Expression Analisys and Transformation " +this.hashCode());
		this.setVisible(true);
	}
	
	/**
	 * This method initializes risultatiDropDownComboBox	
	 * 	
	 * @return javax.swing.JComboBox	
	 */
	private JComboBox getRisultatiDropDownComboBox() {
		if (risultatiDropDownComboBox == null) {
			risultatiDropDownComboBox = new JComboBox();
			risultatiDropDownComboBox.setBackground(new Color(255, 255, 102));
			risultatiDropDownComboBox.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e)
				{
					JComboBox cb = (JComboBox)e.getSource();
					try {
						if (cb.getSelectedItem()!=null) updateFields(null,(String)cb.getSelectedItem());	
					} catch (Exception e1) {
						e1.printStackTrace();
					}
				}
			});
		}
		return risultatiDropDownComboBox;
	}
	
	/**
	 * This method initializes jButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton() {
		if (jButton == null) {
			DefaultButtonModel defaultButtonModel = new DefaultButtonModel();
			defaultButtonModel.setRollover(false);
			jButton = new JButton();
			
			jButton.setText("clear input area");
			jButton.setModel(defaultButtonModel);
			jButton.setOpaque(true);
			jButton.addActionListener(new java.awt.event.ActionListener()
			{
				public void actionPerformed(java.awt.event.ActionEvent e){
					inputTextArea.setText("");
				}
			});
		}
		return jButton;
	}
	
	
	/////////////////////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////
	
	
	private static final long serialVersionUID = 1L;	
	private JPanel jContentPane = null;
	private JPanel jPanelInput = null;
	private JPanel jPanelOutput = null;
	private JTabbedPane resultsMainPane = null;
	private JSplitPane algorithmStepsResultsSplitPane = null;
	private JPanel stepsResultsjPanel = null;
	private JPanel closedFormPanel = null;
	private JPanel implicReducerPanel = null;
	private JPanel negReducerPanel = null;
	private JPanel varRenamePanel = null;
	private JPanel quantAheadPanel = null;
	private JPanel congPrenexPanel = null;
	private JPanel skolemPanel = null;
	private JSplitPane closedFormSplitPane = null;
	private JTextField closedFormTextField = null;
	private JSplitPane implicReducerSplitPane = null;
	private JTextField logicConnectorReductionTextField = null;
	private JSplitPane negReducerSplitPane = null;
	private JTextField negationsReductionTextField = null;
	private JSplitPane varRenameSplitPane = null;
	private JTextField variableRenamingTextField = null;
	private JSplitPane quantAheadSplitPane = null;
	private JTextField quantificationsAHeadTextField = null;
	private JSplitPane congPrenexSplitPane = null;
	private JTextField prenexNormalFormTextField = null;
	private JSplitPane skolemSplitPane = null;
	private JTextField skolemTextField = null;
	private JTextArea logTextArea = null;
	private JPanel removeForAllPanel = null;
	private JSplitPane removeForAllSplitPane = null;
	private JTextField removeForAllTextField = null;
	private JSplitPane jSplitPane2 = null;
	private JButton jButton = null;
	private JScrollPane jScrollPane1 = null;
	private JPanel logPanel = null;
	private JSplitPane logSplitPane = null;
	private JButton clearLogButton = null;
	private JScrollPane logAreaScrollPane = null;
	private JMenuBar jJMenuBar = null;
	private JMenu jMenuFile = null;
	private JMenuItem jMenuItemOpen = null;
	private JMenuItem jMenuItem1Exit = null;
	private JMenu jMenu1History = null;
	private JMenuItem jMenuItemClearHistory = null;
	private JMenuItem jMenuItemDefaultExample = null;
	private JMenuItem jMenuItemClearInputTextArea = null;
	private JDialog OpenFileDialog = null;
	private JPanel OpenFilePanel = null;
	private JFileChooser jFileChooser = null;
	private JTextArea inputTextArea = null;
	
	private JComboBox risultatiDropDownComboBox = null;
	private JButton closedFormButton = null;
	private JButton logicConnectorsReductionButton = null;
	private JButton negationsReducionButton = null;
	private JButton variableRenamingButton = null;
	private JButton quantificationsAheadButton = null;
	private JButton prenexNormalFormButton = null;
	private JButton skolemButton = null;
	private JButton removeForAllButton = null;
	private JPanel removeUnneededBracketjPanel = null;
	private JSplitPane singleOperationsPane1 = null;
	private JButton removeUnneededBracketButton = null;
	private JButton completeTransformationButton1 = null;
	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			GridLayout gridLayout = new GridLayout();
			gridLayout.setRows(2);
			gridLayout.setColumns(1);
			jContentPane = new JPanel();
			jContentPane.setLayout(gridLayout);
			jContentPane.add(getJPanelInput(), null);
			jContentPane.add(getJPanelOutput(), null);
		}
		return jContentPane;
	}

	/**
	 * This method initializes jPanelInput	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanelInput() {
		if (jPanelInput == null) {
			GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
			gridBagConstraints7.fill = GridBagConstraints.BOTH;
			gridBagConstraints7.gridy = 0;
			gridBagConstraints7.weightx = 1.0;
			gridBagConstraints7.weighty = 1.0;
			gridBagConstraints7.gridx = 0;
			jPanelInput = new JPanel();
			jPanelInput.setLayout(new GridBagLayout());
			jPanelInput.add(getJSplitPane2(), gridBagConstraints7);
		}
		return jPanelInput;
	}

	/**
	 * This method initializes jPanelOutput	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanelOutput() {
		if (jPanelOutput == null) {
			GridBagConstraints gridBagConstraints = new GridBagConstraints();
			gridBagConstraints.fill = GridBagConstraints.BOTH;
			gridBagConstraints.weighty = 1.0;
			gridBagConstraints.gridx = 0;
			gridBagConstraints.gridy = 0;
			gridBagConstraints.weightx = 1.0;
			jPanelOutput = new JPanel();
			jPanelOutput.setLayout(new GridBagLayout());
			jPanelOutput.add(getResultsMainPane(), gridBagConstraints);
		}
		return jPanelOutput;
	}

	/**
	 * This method initializes resultsMainPane	
	 * 	
	 * @return javax.swing.JTabbedPane	
	 */
	private JTabbedPane getResultsMainPane() {
		if (resultsMainPane == null) {
			resultsMainPane = new JTabbedPane();
			resultsMainPane.addTab("Algorithm Steps Results", null, getAlgorithmStepsResultsSplitPane(), null);
			resultsMainPane.addTab("log", null, getLogPanel(), null);
		}
		return resultsMainPane;
	}

	/**
	 * This method initializes algorithmStepsResultsSplitPane	
	 * 	
	 * @return javax.swing.JSplitPane	
	 */
	private JSplitPane getAlgorithmStepsResultsSplitPane() {
		if (algorithmStepsResultsSplitPane == null) {
			algorithmStepsResultsSplitPane = new JSplitPane();
			algorithmStepsResultsSplitPane.setDividerSize(3);
			algorithmStepsResultsSplitPane.setDividerLocation(30);
			algorithmStepsResultsSplitPane.setBottomComponent(getStepsResultsjPanel());
			algorithmStepsResultsSplitPane.setTopComponent(getRisultatiDropDownComboBox());
			algorithmStepsResultsSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
		}
		return algorithmStepsResultsSplitPane;
	}

	/**
	 * This method initializes stepsResultsjPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getStepsResultsjPanel() {
		if (stepsResultsjPanel == null) {
			GridLayout gridLayout1 = new GridLayout();
			gridLayout1.setRows(9);
			gridLayout1.setColumns(1);
			stepsResultsjPanel = new JPanel();
			stepsResultsjPanel.setLayout(gridLayout1);
			stepsResultsjPanel.add(getClosedFormPanel(), null);
			stepsResultsjPanel.add(getImplicReducerPanel(), null);
			stepsResultsjPanel.add(getNegReducerPanel(), null);
			stepsResultsjPanel.add(getVarRenamePanel(), null);
			stepsResultsjPanel.add(getQuantAheadPanel(), null);
			stepsResultsjPanel.add(getCongPrenexPanel(), null);
			stepsResultsjPanel.add(getSkolemPanel(), null);
			stepsResultsjPanel.add(getRemoveForAllPanel(), null);
			stepsResultsjPanel.add(getRemoveUnneededBracketjPanel(), null);
		}
		return stepsResultsjPanel;
	}

	/**
	 * This method initializes closedFormPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getClosedFormPanel() {
		if (closedFormPanel == null) {
			GridLayout gridLayout2 = new GridLayout();
			gridLayout2.setRows(1);
			gridLayout2.setColumns(2);
			closedFormPanel = new JPanel();
			closedFormPanel.setLayout(gridLayout2);
			closedFormPanel.add(getClosedFormSplitPane(), null);
		}
		return closedFormPanel;
	}

	/**
	 * This method initializes implicReducerPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getImplicReducerPanel() {
		if (implicReducerPanel == null) {
			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
			gridBagConstraints1.fill = GridBagConstraints.BOTH;
			gridBagConstraints1.weighty = 1.0;
			gridBagConstraints1.weightx = 1.0;
			implicReducerPanel = new JPanel();
			implicReducerPanel.setLayout(new GridBagLayout());
			implicReducerPanel.add(getImplicReducerSplitPane(), gridBagConstraints1);
		}
		return implicReducerPanel;
	}

	/**
	 * This method initializes negReducerPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getNegReducerPanel() {
		if (negReducerPanel == null) {
			GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
			gridBagConstraints2.fill = GridBagConstraints.BOTH;
			gridBagConstraints2.weighty = 1.0;
			gridBagConstraints2.weightx = 1.0;
			negReducerPanel = new JPanel();
			negReducerPanel.setLayout(new GridBagLayout());
			negReducerPanel.add(getNegReducerSplitPane(), gridBagConstraints2);
		}
		return negReducerPanel;
	}

	/**
	 * This method initializes varRenamePanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getVarRenamePanel() {
		if (varRenamePanel == null) {
			GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
			gridBagConstraints3.fill = GridBagConstraints.BOTH;
			gridBagConstraints3.weighty = 1.0;
			gridBagConstraints3.weightx = 1.0;
			varRenamePanel = new JPanel();
			varRenamePanel.setLayout(new GridBagLayout());
			varRenamePanel.add(getVarRenameSplitPane(), gridBagConstraints3);
		}
		return varRenamePanel;
	}

	/**
	 * This method initializes quantAheadPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getQuantAheadPanel() {
		if (quantAheadPanel == null) {
			GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
			gridBagConstraints4.fill = GridBagConstraints.BOTH;
			gridBagConstraints4.weighty = 1.0;
			gridBagConstraints4.weightx = 1.0;
			quantAheadPanel = new JPanel();
			quantAheadPanel.setLayout(new GridBagLayout());
			quantAheadPanel.add(getQuantAheadSplitPane(), gridBagConstraints4);
		}
		return quantAheadPanel;
	}

	/**
	 * This method initializes congPrenexPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getCongPrenexPanel() {
		if (congPrenexPanel == null) {
			GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
			gridBagConstraints5.fill = GridBagConstraints.BOTH;
			gridBagConstraints5.weighty = 1.0;
			gridBagConstraints5.weightx = 1.0;
			congPrenexPanel = new JPanel();
			congPrenexPanel.setLayout(new GridBagLayout());
			congPrenexPanel.add(getCongPrenexSplitPane(), gridBagConstraints5);
		}
		return congPrenexPanel;
	}

	/**
	 * This method initializes skolemPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getSkolemPanel() {
		if (skolemPanel == null) {
			GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
			gridBagConstraints6.fill = GridBagConstraints.BOTH;
			gridBagConstraints6.weighty = 1.0;
			gridBagConstraints6.weightx = 1.0;
			skolemPanel = new JPanel();
			skolemPanel.setLayout(new GridBagLayout());
			skolemPanel.add(getSkolemSplitPane(), gridBagConstraints6);
		}
		return skolemPanel;
	}

	/**
	 * This method initializes closedFormSplitPane	
	 * 	
	 * @return javax.swing.JSplitPane	
	 */
	private JSplitPane getClosedFormSplitPane() {
		if (closedFormSplitPane == null) {
			closedFormSplitPane = new JSplitPane();
			closedFormSplitPane.setDividerSize(1);
			closedFormSplitPane.setLeftComponent(getClosedFormButton());
			closedFormSplitPane.setRightComponent(getClodesFormTextField());
		}
		return closedFormSplitPane;
	}

	/**
	 * This method initializes clodesFormTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getClodesFormTextField() {
		if (closedFormTextField == null) {
			closedFormTextField = new JTextField();
			closedFormTextField.setBackground(new Color(255, 255, 102));
			closedFormTextField.setHorizontalAlignment(JTextField.LEFT);
			closedFormTextField.setEditable(true);
			closedFormTextField.setFont(new Font("Serif", Font.BOLD, 14));
			closedFormTextField.setText("");
		}
		return closedFormTextField;
	}

	/**
	 * This method initializes implicReducerSplitPane	
	 * 	
	 * @return javax.swing.JSplitPane	
	 */
	private JSplitPane getImplicReducerSplitPane() {
		if (implicReducerSplitPane == null) {
			implicReducerSplitPane = new JSplitPane();
			implicReducerSplitPane.setDividerSize(1);
			implicReducerSplitPane.setLeftComponent(getLogicConnectorsReductionButton());
			implicReducerSplitPane.setRightComponent(getLogicConnectorReductionTextField());
		}
		return implicReducerSplitPane;
	}

	/**
	 * This method initializes logciConnectorReductionTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getLogicConnectorReductionTextField() {
		if (logicConnectorReductionTextField == null) {
			logicConnectorReductionTextField = new JTextField();
			logicConnectorReductionTextField.setBackground(new Color(255, 255, 102));
			logicConnectorReductionTextField.setHorizontalAlignment(JTextField.LEFT);
			logicConnectorReductionTextField.setFont(new Font("Serif", Font.BOLD, 14));
			logicConnectorReductionTextField.setText("");
			logicConnectorReductionTextField.setEditable(true);
		}
		return logicConnectorReductionTextField;
	}

	/**
	 * This method initializes negReducerSplitPane	
	 * 	
	 * @return javax.swing.JSplitPane	
	 */
	private JSplitPane getNegReducerSplitPane() {
		if (negReducerSplitPane == null) {
			negReducerSplitPane = new JSplitPane();
			negReducerSplitPane.setDividerSize(1);
			negReducerSplitPane.setLeftComponent(getNegationsReducionButton());
			negReducerSplitPane.setRightComponent(getNegationsReductionTextField());
		}
		return negReducerSplitPane;
	}

	/**
	 * This method initializes negationsReductionTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getNegationsReductionTextField() {
		if (negationsReductionTextField == null) {
			negationsReductionTextField = new JTextField();
			negationsReductionTextField.setBackground(new Color(255, 255, 102));
			negationsReductionTextField.setHorizontalAlignment(JTextField.LEFT);
			negationsReductionTextField.setFont(new Font("Serif", Font.BOLD, 14));
			negationsReductionTextField.setEditable(true);
		}
		return negationsReductionTextField;
	}

	/**
	 * This method initializes varRenameSplitPane	
	 * 	
	 * @return javax.swing.JSplitPane	
	 */
	private JSplitPane getVarRenameSplitPane() {
		if (varRenameSplitPane == null) {
			varRenameSplitPane = new JSplitPane();
			varRenameSplitPane.setDividerSize(1);
			varRenameSplitPane.setLeftComponent(getVariableRenamingButton());
			varRenameSplitPane.setRightComponent(getVariableRenamingTextField());
		}
		return varRenameSplitPane;
	}

	/**
	 * This method initializes variableRenamingTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getVariableRenamingTextField() {
		if (variableRenamingTextField == null) {
			variableRenamingTextField = new JTextField();
			variableRenamingTextField.setBackground(new Color(255, 255, 102));
			variableRenamingTextField.setHorizontalAlignment(JTextField.LEFT);
			variableRenamingTextField.setFont(new Font("Serif", Font.BOLD, 14));
			variableRenamingTextField.setEditable(true);
		}
		return variableRenamingTextField;
	}

	/**
	 * This method initializes quantAheadSplitPane	
	 * 	
	 * @return javax.swing.JSplitPane	
	 */
	private JSplitPane getQuantAheadSplitPane() {
		if (quantAheadSplitPane == null) {
			quantAheadSplitPane = new JSplitPane();
			quantAheadSplitPane.setDividerSize(1);
			quantAheadSplitPane.setLeftComponent(getQuantificationsAheadButton());
			quantAheadSplitPane.setRightComponent(getQuantificationsAHeadTextField());
		}
		return quantAheadSplitPane;
	}

	/**
	 * This method initializes quantificationsAHeadTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getQuantificationsAHeadTextField() {
		if (quantificationsAHeadTextField == null) {
			quantificationsAHeadTextField = new JTextField();
			quantificationsAHeadTextField.setBackground(new Color(255, 255, 102));
			quantificationsAHeadTextField.setHorizontalAlignment(JTextField.LEFT);
			quantificationsAHeadTextField.setFont(new Font("Serif", Font.BOLD, 14));
			quantificationsAHeadTextField.setEditable(true);
		}
		return quantificationsAHeadTextField;
	}

	/**
	 * This method initializes congPrenexSplitPane	
	 * 	
	 * @return javax.swing.JSplitPane	
	 */
	private JSplitPane getCongPrenexSplitPane() {
		if (congPrenexSplitPane == null) {
			congPrenexSplitPane = new JSplitPane();
			congPrenexSplitPane.setDividerSize(1);
			congPrenexSplitPane.setLeftComponent(getPrenexNormalFormButton());
			congPrenexSplitPane.setRightComponent(getPrenexNormalFormTextField());
		}
		return congPrenexSplitPane;
	}

	/**
	 * This method initializes prenexNormalFormTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getPrenexNormalFormTextField() {
		if (prenexNormalFormTextField == null) {
			prenexNormalFormTextField = new JTextField();
			prenexNormalFormTextField.setBackground(new Color(255, 255, 102));
			prenexNormalFormTextField.setHorizontalAlignment(JTextField.LEFT);
			prenexNormalFormTextField.setFont(new Font("Serif", Font.BOLD, 14));
			prenexNormalFormTextField.setEditable(true);
		}
		return prenexNormalFormTextField;
	}

	/**
	 * This method initializes skolemSplitPane	
	 * 	
	 * @return javax.swing.JSplitPane	
	 */
	private JSplitPane getSkolemSplitPane() {
		if (skolemSplitPane == null) {
			skolemSplitPane = new JSplitPane();
			skolemSplitPane.setDividerSize(1);
			skolemSplitPane.setLeftComponent(getSkolemButton());
			skolemSplitPane.setRightComponent(getSkolemTextField());
		}
		return skolemSplitPane;
	}

	/**
	 * This method initializes skolemTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getSkolemTextField() {
		if (skolemTextField == null) {
			skolemTextField = new JTextField();
			skolemTextField.setBackground(new Color(255, 255, 102));
			skolemTextField.setHorizontalAlignment(JTextField.LEFT);
			skolemTextField.setFont(new Font("Serif", Font.BOLD, 14));
			skolemTextField.setEditable(true);
		}
		return skolemTextField;
	}

	/**
	 * This method initializes logTextArea	
	 * 	
	 * @return javax.swing.JTextArea	
	 */
	private JTextArea getLogTextArea() {
		if (logTextArea == null) {
			logTextArea = new JTextArea();
			logTextArea.setBackground(SystemColor.activeCaptionBorder);
			logTextArea.setText("");
			logTextArea.setBorder(null);
		}
		return logTextArea;
	}

	/**
	 * This method initializes removeForAllPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getRemoveForAllPanel() {
		if (removeForAllPanel == null) {
			GridBagConstraints gridBagConstraints61 = new GridBagConstraints();
			gridBagConstraints61.fill = GridBagConstraints.BOTH;
			gridBagConstraints61.weighty = 1.0;
			gridBagConstraints61.weightx = 1.0;
			removeForAllPanel = new JPanel();
			removeForAllPanel.setLayout(new GridBagLayout());
			removeForAllPanel.add(getRemoveForAllSplitPane(), gridBagConstraints61);
		}
		return removeForAllPanel;
	}

	/**
	 * This method initializes removeForAllSplitPane	
	 * 	
	 * @return javax.swing.JSplitPane	
	 */
	private JSplitPane getRemoveForAllSplitPane() {
		if (removeForAllSplitPane == null) {
			removeForAllSplitPane = new JSplitPane();
			removeForAllSplitPane.setDividerSize(1);
			removeForAllSplitPane.setLeftComponent(getRemoveForAllButton());
			removeForAllSplitPane.setRightComponent(getRemoveForAllTextField());
		}
		return removeForAllSplitPane;
	}

	/**
	 * This method initializes removeForAllTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getRemoveForAllTextField() {
		if (removeForAllTextField == null) {
			removeForAllTextField = new JTextField();
			removeForAllTextField.setBackground(new Color(255, 255, 102));
			removeForAllTextField.setHorizontalAlignment(JTextField.LEFT);
			removeForAllTextField.setFont(new Font("Serif", Font.BOLD, 14));
			removeForAllTextField.setEditable(true);
		}
		return removeForAllTextField;
	}

	/**
	 * This method initializes jSplitPane2	
	 * 	
	 * @return javax.swing.JSplitPane	
	 */
	private JSplitPane getJSplitPane2() {
		if (jSplitPane2 == null) {
			jSplitPane2 = new JSplitPane();
			jSplitPane2.setDividerSize(2);
			jSplitPane2.setTopComponent(getJButton());
			jSplitPane2.setBottomComponent(getJScrollPane1());
			jSplitPane2.setOrientation(JSplitPane.VERTICAL_SPLIT);
		}
		return jSplitPane2;
	}

	/**
	 * This method initializes jScrollPane1	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getJScrollPane1() {
		if (jScrollPane1 == null) {
			jScrollPane1 = new JScrollPane();
			jScrollPane1.setViewportView(getInputTextArea());
		}
		return jScrollPane1;
	}

	/**
	 * This method initializes inputTextArea	
	 * 	
	 * @return javax.swing.JTextArea	
	 */
	private JTextArea getInputTextArea() {
		if (inputTextArea == null) {
			inputTextArea = new JTextArea();
			
			// 2 righe non aggiunte in modo automatico..
			Font font = new Font("Serif", Font.BOLD, 30);
			inputTextArea.setFont(font);
			
			inputTextArea.setBackground(new Color(204, 255, 255));
			inputTextArea.setToolTipText("type here your first order logic expressions...");
			inputTextArea.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
			inputTextArea.setMargin(new Insets(0, 0, 0, 0));
			inputTextArea.setLocation(new Point(0, 0));
			inputTextArea.setText("(a and b and c) or d or (e and f); ");
		}
		return inputTextArea;
	}

	/**
	 * This method initializes logPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getLogPanel() {
		if (logPanel == null) {
			GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
			gridBagConstraints8.fill = GridBagConstraints.BOTH;
			gridBagConstraints8.weighty = 1.0;
			gridBagConstraints8.weightx = 1.0;
			logPanel = new JPanel();
			logPanel.setLayout(new GridBagLayout());
			logPanel.setBackground(Color.yellow);
			logPanel.add(getLogSplitPane(), gridBagConstraints8);
		}
		return logPanel;
	}

	/**
	 * This method initializes logSplitPane	
	 * 	
	 * @return javax.swing.JSplitPane	
	 */
	private JSplitPane getLogSplitPane() {
		if (logSplitPane == null) {
			logSplitPane = new JSplitPane();
			logSplitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
			logSplitPane.setDividerLocation(90);
			logSplitPane.setLeftComponent(getClearLogButton());
			logSplitPane.setRightComponent(getLogAreaScrollPane());
			logSplitPane.setDividerSize(10);
		}
		return logSplitPane;
	}

	/**
	 * This method initializes clearLogButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getClearLogButton() {
		if (clearLogButton == null) {
			clearLogButton = new JButton();
			clearLogButton.setText("clear");
			clearLogButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					logTextArea.setText("");
				}
			});
		}
		return clearLogButton;
	}

	/**
	 * This method initializes logAreaScrollPane	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getLogAreaScrollPane() {
		if (logAreaScrollPane == null) {
			logAreaScrollPane = new JScrollPane();
			logAreaScrollPane.setViewportView(getLogTextArea());
		}
		return logAreaScrollPane;
	}

	/**
	 * This method initializes jJMenuBar	
	 * 	
	 * @return javax.swing.JMenuBar	
	 */
	private JMenuBar getJJMenuBar() {
		if (jJMenuBar == null) {
			jJMenuBar = new JMenuBar();
			jJMenuBar.add(getJMenuFile());
			jJMenuBar.add(getJMenu1History());
		}
		return jJMenuBar;
	}

	/**
	 * This method initializes jMenuFile	
	 * 	
	 * @return javax.swing.JMenu	
	 */
	private JMenu getJMenuFile() {
		if (jMenuFile == null) {
			jMenuFile = new JMenu();
			jMenuFile.setText("File");
			jMenuFile.add(getJMenuItemOpen());
			jMenuFile.add(getJMenuItemClearInputTextArea());
			jMenuFile.add(getJMenuItemClearHistory());
			jMenuFile.add(getJMenuItem1Exit());
		}
		return jMenuFile;
	}

	/**
	 * This method initializes jMenuItemOpen	
	 * 	
	 * @return javax.swing.JMenuItem	
	 */
	private JMenuItem getJMenuItemOpen() {
		if (jMenuItemOpen == null) {
			jMenuItemOpen = new JMenuItem();
			jMenuItemOpen.setText("Open");
			jMenuItemOpen.addActionListener(new java.awt.event.ActionListener()
			{
				public void actionPerformed(java.awt.event.ActionEvent e)
				{
					JFileChooser jf =new JFileChooser();
					jf.setCurrentDirectory(new File("."));
					int returnVal = jf.showOpenDialog(getOpenFilePanel());
					if(returnVal == JFileChooser.APPROVE_OPTION) {
						try {							
							BufferedReader br = new BufferedReader(new FileReader(jf.getSelectedFile()));
							getInputTextArea().read(br, null);
							br.close();
						} catch (FileNotFoundException e1) {
							JScrollPane jsp=new JScrollPane();
							jsp.setViewportView(new JTextArea(e1.toString()));
							getAlgorithmStepsResultsSplitPane().setBottomComponent(jsp);
						} catch (IOException e1) {
							JScrollPane jsp=new JScrollPane();
							jsp.setViewportView(new JTextArea(e1.toString()));
							getAlgorithmStepsResultsSplitPane().setBottomComponent(jsp);
						}
					}					
				}
			});
		}
		return jMenuItemOpen;
	}

	/**
	 * This method initializes jMenuItem1Exit	
	 * 	
	 * @return javax.swing.JMenuItem	
	 */
	private JMenuItem getJMenuItem1Exit() {
		if (jMenuItem1Exit == null) {
			jMenuItem1Exit = new JMenuItem();
			jMenuItem1Exit.setText("Exit");
			jMenuItem1Exit.addActionListener(new java.awt.event.ActionListener()
			{
				public void actionPerformed(java.awt.event.ActionEvent e)
				{
					System.exit(0);
				}
			});
		}
		return jMenuItem1Exit;
	}

	/**
	 * This method initializes jMenu1History	
	 * 	
	 * @return javax.swing.JMenu	
	 */
	private JMenu getJMenu1History() {
		if (jMenu1History == null) {
			jMenu1History = new JMenu();
			jMenu1History.setText("History");
			jMenu1History.setActionCommand("History");

			jMenu1History.add(getJMenuItemDefaultExample());
		}
		return jMenu1History;
	}

	/**
	 * This method initializes jMenuItemClearHistory	
	 * 	
	 * @return javax.swing.JMenuItem	
	 */
	private JMenuItem getJMenuItemClearHistory() {
		if (jMenuItemClearHistory == null) {
			jMenuItemClearHistory = new JMenuItem();
			jMenuItemClearHistory.setText("Clear History");
			jMenuItemClearHistory.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					jMenu1History.removeAll();
				}
			});
		}
		return jMenuItemClearHistory;
	}

	/**
	 * This method initializes jMenuItemDefaultExample	
	 * 	
	 * @return javax.swing.JMenuItem	
	 */
	private JMenuItem getJMenuItemDefaultExample() {
		if (jMenuItemDefaultExample == null) {
			jMenuItemDefaultExample = new JMenuItem();
			jMenuItemDefaultExample.setText("forall X exists Y p(X,Y,Z);\np(F,G,H);" + "\n");	
			jMenuItemDefaultExample.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					inputTextArea.setText(jMenuItemDefaultExample.getText());
				}
			});
		}
		return jMenuItemDefaultExample;
	}

	/**
	 * This method initializes jMenuItemClearInputTextArea	
	 * 	
	 * @return javax.swing.JMenuItem	
	 */
	private JMenuItem getJMenuItemClearInputTextArea() {
		if (jMenuItemClearInputTextArea == null) {
			jMenuItemClearInputTextArea = new JMenuItem();
			jMenuItemClearInputTextArea.setText("Clear Input Area");
			jMenuItemClearInputTextArea.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					inputTextArea.setText("");
				}
			});
		}
		return jMenuItemClearInputTextArea;
	}

	/**
	 * This method initializes OpenFileDialog	
	 * 	
	 * @return javax.swing.JDialog	
	 */
	private JDialog getOpenFileDialog() {
		if (OpenFileDialog == null) {
			OpenFileDialog = new JDialog();
			OpenFileDialog.setTitle("Open File");
			OpenFileDialog.setContentPane(getOpenFilePanel());
		}
		return OpenFileDialog;
	}

	/**
	 * This method initializes OpenFilePanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getOpenFilePanel() {
		if (OpenFilePanel == null) {
			OpenFilePanel = new JPanel();
			OpenFilePanel.setLayout(new BorderLayout());
			OpenFilePanel.add(getJFileChooser(), java.awt.BorderLayout.CENTER);
		}
		return OpenFilePanel;
	}

	/**
	 * This method initializes jFileChooser	
	 * 	
	 * @return javax.swing.JFileChooser	
	 */
	private JFileChooser getJFileChooser() {
		if (jFileChooser == null) {
			jFileChooser = new JFileChooser();
		}
		return jFileChooser;
	}

	/**
	 * This method initializes closedFormButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getClosedFormButton() {
		if (closedFormButton == null) {
			closedFormButton = new JButton();
			closedFormButton.setName("");
			closedFormButton.setText("Closed Form");
			closedFormButton.setPreferredSize(new Dimension(250, 26));
			closedFormButton.setMnemonic(KeyEvent.VK_UNDEFINED);
			closedFormButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e)
				{
					int index= risultatiDropDownComboBox.getSelectedIndex();
					exec_action(null, CompilerConstants.CLOSE,true);
					risultatiDropDownComboBox.setSelectedIndex(index);
				}
			});
		}
		return closedFormButton;
	}


	/**
	 * This method initializes logicConnectorsReductionButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getLogicConnectorsReductionButton() {
		if (logicConnectorsReductionButton == null) {
			logicConnectorsReductionButton = new JButton();
			logicConnectorsReductionButton.setText("Logic Connectors Reduction");
			logicConnectorsReductionButton.setPreferredSize(new Dimension(250, 26));
			logicConnectorsReductionButton
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							int index= risultatiDropDownComboBox.getSelectedIndex();
							exec_action(null, CompilerConstants.IMPL_RED,true);
							risultatiDropDownComboBox.setSelectedIndex(index);
						}
					});
		}
		return logicConnectorsReductionButton;
	}


	/**
	 * This method initializes negationsReducionButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getNegationsReducionButton() {
		if (negationsReducionButton == null) {
			negationsReducionButton = new JButton();
			negationsReducionButton.setMnemonic(KeyEvent.VK_UNDEFINED);
			negationsReducionButton.setPreferredSize(new Dimension(250, 26));
			negationsReducionButton.setText("Application of negations to athoms");
			negationsReducionButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					int index= risultatiDropDownComboBox.getSelectedIndex();
					exec_action(null, CompilerConstants.NEG_RED,true);
					risultatiDropDownComboBox.setSelectedIndex(index);

				}
			});
		}
		return negationsReducionButton;
	}



	/**
	 * This method initializes variableRenamingButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getVariableRenamingButton() {
		if (variableRenamingButton == null) {
			variableRenamingButton = new JButton();
			variableRenamingButton.setText("Variable Renaming (conflicts)");
			variableRenamingButton.setPreferredSize(new Dimension(250, 26));
			variableRenamingButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					int index= risultatiDropDownComboBox.getSelectedIndex();
					exec_action(null, CompilerConstants.VAR_REN,true);
					risultatiDropDownComboBox.setSelectedIndex(index);
				}
			});
		}
		return variableRenamingButton;
	}


	/**
	 * This method initializes quantificationsAheadButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getQuantificationsAheadButton() {
		if (quantificationsAheadButton == null) {
			quantificationsAheadButton = new JButton();
			quantificationsAheadButton.setMnemonic(KeyEvent.VK_UNDEFINED);
			quantificationsAheadButton.setPreferredSize(new Dimension(250, 26));
			quantificationsAheadButton.setToolTipText("Move all quantifications ahead (Prenex Form)");
			quantificationsAheadButton.setText("Prenex Form");
			quantificationsAheadButton
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							int index= risultatiDropDownComboBox.getSelectedIndex();
							exec_action(null, CompilerConstants.QUANT_AHEAD,true);
							risultatiDropDownComboBox.setSelectedIndex(index);
						}
					});
		}
		return quantificationsAheadButton;
	}


	/**
	 * This method initializes prenexNormalFormButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getPrenexNormalFormButton() {
		if (prenexNormalFormButton == null) {
			prenexNormalFormButton = new JButton();
			prenexNormalFormButton.setToolTipText("Conjuntive Normal Form");
			prenexNormalFormButton.setPreferredSize(new Dimension(250, 26));
			prenexNormalFormButton.setText("Conjuntive Normal Form");
			prenexNormalFormButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					int index= risultatiDropDownComboBox.getSelectedIndex();
					exec_action(null, CompilerConstants.PRENEX_CONG,true);
					risultatiDropDownComboBox.setSelectedIndex(index);
				}
			});
		}
		return prenexNormalFormButton;
	}

	
	/**
	 * This method initializes skolemButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getSkolemButton() {
		if (skolemButton == null) {
			skolemButton = new JButton();
			skolemButton.setText("Skolemization");
			skolemButton.setPreferredSize(new Dimension(250, 26));
			skolemButton.setToolTipText("apply Skolem Function");
			skolemButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					int index= risultatiDropDownComboBox.getSelectedIndex();
					exec_action(null, CompilerConstants.SKOLEM,true);
					risultatiDropDownComboBox.setSelectedIndex(index);
				}
			});
		}
		return skolemButton;
	}


	/**
	 * This method initializes removeForAllButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getRemoveForAllButton() {
		if (removeForAllButton == null) {
			removeForAllButton = new JButton();
			removeForAllButton.setMnemonic(KeyEvent.VK_UNDEFINED);
			removeForAllButton.setPreferredSize(new Dimension(250, 26));
			removeForAllButton.setText("Remove Universal Quantifications");
			removeForAllButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					int index= risultatiDropDownComboBox.getSelectedIndex();
					exec_action(null, CompilerConstants.REMOVE_FORALL,true);
					risultatiDropDownComboBox.setSelectedIndex(index);
				}
			});
		}
		return removeForAllButton;
	}

	
	/**
	 * This method initializes removeUnneededBracketjPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getRemoveUnneededBracketjPanel() {
		if (removeUnneededBracketjPanel == null) {
			GridBagConstraints gridBagConstraints612 = new GridBagConstraints();
			gridBagConstraints612.fill = GridBagConstraints.BOTH;
			gridBagConstraints612.weighty = 1.0;
			gridBagConstraints612.weightx = 1.0;
			removeUnneededBracketjPanel = new JPanel();
			removeUnneededBracketjPanel.setBackground(Color.GRAY);
			removeUnneededBracketjPanel.setLayout(new GridBagLayout());
			removeUnneededBracketjPanel.add(getSingleOperationsPane1(), gridBagConstraints612);
		}
		return removeUnneededBracketjPanel;
	}

	
	/**
	 * This method initializes singleOperationsPane1	
	 * 	
	 * @return javax.swing.JSplitPane	
	 */
	private JSplitPane getSingleOperationsPane1() {
		if (singleOperationsPane1 == null) {
			singleOperationsPane1 = new JSplitPane();
			singleOperationsPane1.setDividerSize(1);
			singleOperationsPane1.setLeftComponent(getRemoveUnneededBracketButton());
			singleOperationsPane1.setRightComponent(getCompleteTransformationButton1());
			singleOperationsPane1.setBackground(Color.GRAY);
		}
		return singleOperationsPane1;
	}

	
	/**
	 * This method initializes removeUnneededBracketButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getRemoveUnneededBracketButton() {
		if (removeUnneededBracketButton == null) {
			removeUnneededBracketButton = new JButton();
			removeUnneededBracketButton.setPreferredSize(new Dimension(250, 26));
			removeUnneededBracketButton.setText("Remove Unneeded Brackets");
			removeUnneededBracketButton.setActionCommand("Remove Unneeded Brackets");
			removeUnneededBracketButton.setMnemonic(KeyEvent.VK_UNDEFINED);
			removeUnneededBracketButton
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							int index= risultatiDropDownComboBox.getSelectedIndex();
							exec_action(null, CompilerConstants.REMOVE_BRACKET,false);
							risultatiDropDownComboBox.setSelectedIndex(index);
						}
					});
		}
		return removeUnneededBracketButton;
	}

	
	void exec_action(String inputLine, String op, boolean chain)
	{
		// clear all output data
		risultatiDropDownComboBox.removeAllItems();
		
		closedFormTextField.setText("");
		logicConnectorReductionTextField.setText("");
		negationsReductionTextField.setText("");
		variableRenamingTextField.setText("");
		quantificationsAHeadTextField.setText("");
		prenexNormalFormTextField.setText("");
		skolemTextField.setText("");
		removeForAllTextField.setText("");

		PrintStream ps_out = new PrintStream( new TextAreaOutputStream( logTextArea ) );
		StringReader ps_in = new StringReader(inputTextArea.getText());
		
		//preparo un menu item e lo aggiungo al menu history
		JMenuItem m = new JMenuItem(inputTextArea.getText());
		final String menutext = m.getText();
		m.addActionListener(new java.awt.event.ActionListener() {	
			public void actionPerformed(java.awt.event.ActionEvent e){
				inputTextArea.setText(menutext);
			}	
		});
		jMenu1History.add(m); // con duplicati
					
		// start della trasformazione in clausole
		Collection<String> lines = null;
		
		ParseErrorWindow parseErrorMessageDialog = null;
		
		// INVOCAZIONE DEL COMPILATORE
		try {
			lines = compiler.do_transformation(ps_in, ps_out, op, chain);
		}
		catch (TokenMgrError e1) {
			parseErrorMessageDialog = new ParseErrorWindow(this,e1.getMessage());
			// se si verifica un'eccezione rendo visibile il tab del log
			resultsMainPane.setSelectedIndex(1);
			e1.printStackTrace();
		} 
		catch (ParseException e1) {
			parseErrorMessageDialog = new ParseErrorWindow(this,e1.getMessage());
			// se si verifica un'eccezione rendo visibile il tab del log
			resultsMainPane.setSelectedIndex(1);
			e1.printStackTrace();
		} 
		catch (Exception e1) {
			String errorMessage = "ERRORE GENERICO:\n " + e1.getMessage();
			parseErrorMessageDialog = new ParseErrorWindow(this,errorMessage);
			e1.printStackTrace();
			// se si verifica un'eccezione rendo visibile il tab del log
			resultsMainPane.setSelectedIndex(1);
		} 
		
		// RIEMPIMENTO DEL DROP DOWN COMBO BOX - creo un item per ogni linea della teoria di input
		// solo per l'item selezionati invoco il metodo updateFields che prende i dati dal CompilerState contenuto nel compilatore
		Iterator lines_iterator = lines.iterator();
		while (lines_iterator.hasNext())
		{
			String line = (String)lines_iterator.next();
			risultatiDropDownComboBox.addItem(line);
			
			if (   line.equals( (String)risultatiDropDownComboBox.getSelectedItem() )  )
			{
				// collect results
				StepsImagesContainer stepsImagesContainer = compiler.getState().getStateMap().get(line);
				
				// display result
				try { if (stepsImagesContainer!=null) updateFields(stepsImagesContainer, stepsImagesContainer.getInputExpr()); }
				catch (Exception e1) {
					e1.printStackTrace();
					resultsMainPane.setSelectedIndex(1);
				}
			}
		}
		
	}
	
	
	private void updateFields(StepsImagesContainer container,String name) throws Exception
	{
		logTextArea.append("UPDATE-FIELDS!\n");
		if (container==null){
			container = compiler.getState().getStateMap().get(name);
			//if (container==null) throw new Exception("Dati non trovati per espressione: "+name);
		}
		
		if (container !=null)
		{			
			this.closedFormTextField.setText(container.getExpr(CompilerConstants.CLOSE));
			this.logicConnectorReductionTextField.setText(container.getExpr(CompilerConstants.IMPL_RED));
			this.negationsReductionTextField.setText(container.getExpr(CompilerConstants.NEG_RED));
			this.variableRenamingTextField.setText(container.getExpr(CompilerConstants.VAR_REN));
			this.quantificationsAHeadTextField.setText(container.getExpr(CompilerConstants.QUANT_AHEAD));
			this.prenexNormalFormTextField.setText(container.getExpr(CompilerConstants.PRENEX_CONG));
			this.skolemTextField.setText(container.getExpr(CompilerConstants.SKOLEM));
			this.removeForAllTextField.setText(container.getExpr(CompilerConstants.REMOVE_FORALL));
		}
		
	}

	/**
	 * This method initializes completeTransformationButton1	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getCompleteTransformationButton1() {
		if (completeTransformationButton1 == null) {
			completeTransformationButton1 = new JButton();
			completeTransformationButton1.setText("Execute Transformation");
			completeTransformationButton1.setFont(new Font("Comic Sans MS", Font.PLAIN, 18));
			completeTransformationButton1.setContentAreaFilled(true);
			completeTransformationButton1.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED), new SoftBevelBorder(SoftBevelBorder.RAISED)));
			completeTransformationButton1.setBackground(new Color(153, 153, 153));
			completeTransformationButton1
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							int index= risultatiDropDownComboBox.getSelectedIndex();
							exec_action(null, CompilerConstants.END,true);
							risultatiDropDownComboBox.setSelectedIndex(index);
						}
					});
		}
		return completeTransformationButton1;
	}
	

}
